<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
					<div><font color="blue">说明：数据源配置错误时，保存可能会耗时较长，建议连接测试通过后再进行保存</font><br/></div>
						<form class="form-horizontal m-t" id="signupForm">
							<input id="sourceId" name="sourceId"
								th:value="${source.sourceId}" type="hidden">
							<div class="form-group">
								<label class="col-sm-3 control-label">数据源名称：</label>
								<div class="col-sm-8">
									<input id="sourceName" name="sourceName" class="form-control"
										type="text" th:value="${source.sourceName}" required>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">数据源编码：</label>
								<div class="col-sm-8">
									<input id="sourceCode" name="sourceCode" class="form-control"
										type="text" th:value="${source.sourceCode}" required>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">数据库类型：</label>
								<div class="col-sm-8">
									<select data-placeholder="--请选择--" name="sourceType"
										id="sourceType" class="form-control chosen-select"
										tabindex="2" required>
										<option value="1" th:selected="${source.sourceType == 1}">Oracle</option>
										<option value="2" th:selected="${source.sourceType == 2}">MySQL</option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">IP：</label>
								<div class="col-sm-8">
									<input id="ipAddress" name="ipAddress" class="form-control"
										type="text" th:value="${source.ipAddress}" required>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">端口号：</label>
								<div class="col-sm-8">
									<input id="port" name=port class="form-control" type="number"
										size="6" th:value="${source.port}" required>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">数据库名称：</label>
								<div class="col-sm-8">
									<input id="dbName" name="dbName" class="form-control"
										type="text" th:value="${source.dbName}" required>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">用户名：</label>
								<div class="col-sm-8">
									<input id="dbUser" name="dbUser" class="form-control"
										type="text" th:value="${source.dbUser}" required>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">密码：</label>
								<div class="col-sm-8">
									<input id="dbPassword" name="dbPassword" class="form-control"
										type="password" th:value="${source.dbPassword}" required>
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="button" onclick="connTest()"
										class="btn btn-warning">连接测试</button>
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div th:include="include::footer"></div>
	<script th:inline="javascript"> var ctx = [[@{/}]] ; </script>
	<script type="text/javascript" src="/js/app/metadata/source/edit.js"
		th:src="@{/js/app/metadata/source/edit.js}"></script>
</body>
</html>
